<?php

/**
 * Author form.
 *
 * @package    MonSite
 * @subpackage formf
 * @author     LI Chen
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class AuthorForm extends BaseAuthorForm {

    public function configure() {


        $keys1 = range(1, 18);
        $keys2 = range(19, 100);
        $choices1 = array_combine($keys1, $keys1);
        $choices2 = array_combine($keys2, $keys2);

        $choices = array(
            'Children' => $choices1,
            'Adult' => $choices2,
        );

        $this->setWidgets(array(
            'name' => new sfWidgetFormInputText(array(), array('class' => 'span3', 'placeholder' => 'Enter ur name here')),
            'age' => new sfWidgetFormChoice(array('choices' => $choices, 'default' => 18), array('class' => 'span2')),
            'sex' => new sfWidgetFormSelectRadio(array('choices' => array('male' => 'Male', 'female' => 'Female'), 'class' => 'inputs-list')),
            'address' => new sfWidgetFormInputText(array(), array('class' => 'span5', 'placeholder' => 'Enter ur address here')),
        ));

        $this->widgetSchema->setNameFormat('WTF_form[%s]');
        //$this->widgetSchema->setNameFormat('author[%s]');
        $this->validatorSchema->setOption('allow_extra_fields', true);
    }

}
